package com.yxdj.service.api.factory;

import com.yxdj.common.core.domain.R;
import com.yxdj.service.api.RemoteServiceDetailService;
import com.yxdj.service.api.domain.ServiceDetail;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @author 韩总
 */
public class RemoteServiceDetailFallbackFactory implements FallbackFactory<RemoteServiceDetailService> {
    @Override
    public RemoteServiceDetailService create(Throwable cause) {
        return new RemoteServiceDetailService() {
            @Override
            public R<ServiceDetail> getServiceDetailById(Long id, String source) {
                return R.fail("远程调用服务微服务根据id查询服务详情失败："+cause.getMessage());
            }
        };
    }
}
